package pl.egraveyard.dao;

import org.apache.commons.lang.Validate;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import pl.egraveyard.domain.Klient;

/**
 * Implementacja Dao {@link KlientDao}
 * @author gunos
 *
 */
public class KlientDaoImpl extends AbstractDaoSupportImpl<Klient> implements KlientDao{
	/**
	 * {@inheritDoc}
	 */
	@Override
	public Klient read(String login) {
		Validate.notEmpty(login);
		Criteria crit = getCurrentSession().createCriteria(Klient.class).add(
				Restrictions.eq("login", login));
		return (Klient) crit.uniqueResult();
	}

}
